﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections.Specialized;

namespace Widgetsphere.Autos.Websitev2.Objects
{
	public static class DimensionFormatHelper
	{
		private static NameValueCollection _prettyNameList = null;
		public static string GetFormattedDimensionName(string dimensionName)
		{
			//Get the collection if first time
			if (_prettyNameList == null)
				_prettyNameList = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection("DimensionNames");

			//Get the formatted name. If not found return the specified dimension name
			if (_prettyNameList == null)
			{
				return dimensionName; 
			}
			else
			{
				string retval = _prettyNameList[dimensionName];
				if (retval == null) retval = dimensionName;
				return retval;
			}
		}

	}
}